/**************************************************************************************
 *  Copyright (c)  2010  Leszek Karcz.
 *  Permission is granted to copy, distribute and/or modify this document
 *  under the terms of the GNU Free Documentation License, Version 1.3
 *  or any later version published by the Free Software Foundation;
 *  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 *  A copy of the license is included in the section entitled "GNU
 *  Free Documentation License". 
 **************************************************************************************/
package data.tileables;

/**************************************************************************************
 * Author(s): Leszek Karcz
 * Increase controllable armor value
 **************************************************************************************/
public class ItemArmorUp extends Item
{
	private int value;
	
	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * ArmorUp constructor
	 **************************************************************************************/
	public ItemArmorUp()
	{
		this(5); //default value
	}
	public ItemArmorUp(int value)
	{
		super();
		if(value>0)
		{
			this.value=value;
		}
		else
		{
			this.value=15;
		}
		this.setType("Item_Armor_Up");
		this.setImage("item_armor_up");
	}
	
	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * Orders the controllable to increase it's armor
	 **************************************************************************************/
	public void execute(Controllable controllable)
	{
		//Increase armor
		controllable.changeArmor(this.value);
	}
}